<?php

$module = new \stdClass;

$module->name    = 'Wysiwygs';
$module->title   = 'Визуальный редактор';
$module->version = '1.0';
$module->author  = 'Vlad Andreev <php.vlad@gmail.com>';

$module->tables = array(
    'wysiwygs' => array(
        'id' => array('type' => 'int', 'length' => 10, 'not_null' => 1, 'auto_increment' => 1),
        'name' => array('type' => 'text', 'not_null' => 1),
        'title' => array('type' => 'text', 'not_null' => 1),
        'caption' => array('type' => 'text', 'not_null' => 1),
        'path' => array('type' => 'text', 'not_null' => 1),
        'skins' => array('type' => 'text', 'not_null' => 1),
        'skin' => array('type' => 'text', 'not_null' => 1),
        'themes' => array('type' => 'text', 'not_null' => 1),
        'theme' => array('type' => 'text', 'not_null' => 1),
        'use_default' => array('type' => 'int', 'length' => 1, 'not_null' => 1, 'default' => 0),
        'active' => array('type' => 'int', 'length' => 1, 'not_null' => 1, 'default' => 0),
    )
);

$module->data_types = array(
    'Wysiwyg' => array(
        'title' => 'Wysiwyg',
        'entity' => 'Wysiwyg',
        'fields' => array(
            'name' => array(
                'title' => 'Идентификатор',
                'type' => 'textbox'
            ),
            'title' => array(
                'title' => 'Заголовок',
                'type' => 'textbox'
            ),
            'caption' => array(
                'title' => 'Описание',
                'type' => 'textbox'
            ),
            'template' => array(
                'title' => 'Шаблон',
                'type' => 'select',
                'options' => 'index=Главная,main=Основной',
                'status' => 'static'
            ),
            'text' => array(
                'title' => 'Текст',
                'type' => 'textarea',
                'attributes' => 'rows=17 cols=80 class=wysiwyg'
            ),
            'show_in_menu' => array(
                'title' => 'Показывать в меню',
                'type' => 'checkbox',
                'attributes' => 'class=checkbox'
            ),
            'use_default' => array(
                'title' => 'Использовать по умолчанию',
                'type' => 'checkbox',
                'attributes' => 'class=checkbox'
            ),
            'active' => array(
                'title' => 'Включена',
                'type' => 'checkbox',
                'attributes' => 'class=checkbox'
            )
        )
    ),
);

$module->menu = array(
    array(
        'name' => 'control',
        'childs' => array(
            array(
                'name' => 'wysiwygs',
                'title' => 'Визуальный редактор',
                'page' => 'settings',
                'weight' => 30,
            )
        )
    )
);

$module->content = array(
    'UserPermission' => array(
        array('title' => 'Настройки', 'page' => 'settings', 'action' => 'settings'),
        array('title' => 'Просмотр файлов на сервере', 'action' => 'browse'),
    ),
    'Wysiwyg' => array(
        array(
            'name' => 'ckeditor',
            'title' => 'CKEditor',
            'caption' => 'CKEditor 4.0.1',
            'path' => 'CKEditor/ckeditor.js',
            'skins' => '[{"moono":"Moono: new style"},{"kama":"Kama: 3.-style"}]',
            'skin' => 'moono',
            'themes' => '[{"Basic":"Простой"},{"Normal":"Средний"},{"Full":"Полный"}]',
            'theme' => 'Normal',
            'use_default' => 1,
            'active' => 1
        )/*,
        array(
            'name' => 'tinymce',
            'title' => 'TinyMCE',
            'caption' => 'TinyMCE 3.2.7 (jQuery version)',
            'path' => 'TinyMCE.jquery/jscripts/tiny_mce/jquery.tinymce.js',
            'skins' => 'default=default,o2k7=o2k7,o2k7--silver=o2k7 (silver),o2k7--black=o2k7 (black)',
            'skin' => 'o2k7',
            'themes' => '[{"basic":"Простой"},{"normal":"Средний"},{"full":"Полный"}]',
            'theme' => 'normal',
            'def' => 0,
            'active' => 1
        ),
        array(
            'name' => 'fckeditor',
            'title' => 'FCKeditor',
            'caption' => 'FCKeditor 2.6.5',
            'path' => 'fckeditor/fckeditor.js',
            'skins' => 'default=default,office2003=Office2003,silver=silver',
            'skin' => 'default',
            'themes' => '[{"Basic":"Простой"},{"Normal":"Средний"},{"Full":"Полный"}]',
            'theme' => 'Normal',
            'def' => 0,
            'active' => 1
        )*/
    )
);

return $module;